var form = layui.form;
layer = parent.layer === undefined ? layui.layer : top.layer;
    $ = layui.jquery;
function sub(data){
    var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.5});
    $.post("/staff/edit",{
        id:$(".id").val(),
        user : $(".user").val(),
        name : $(".name").val(),
        age: $(".age").val(),
        workYear: $(".workYear").val(),
        ability : $(".ability").val(),
        post: $(".post").val(),
        grade : $(".grade").val()
    },function(res){
        if(res.code===0){
            layer.msg(res.msg,{
                icon: 1,
                time: 2000 //2秒关闭（如果不配置，默认是3秒）
            });
            console.log(window.name);
            var index = parent.layer.getFrameIndex(window.name);
            parent.layui.table.reload('staffListTable');
            parent.layer.close(index);

        }else {
            layer.msg(res.msg);
        }
    })
}